<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>angular的事件绑定</title>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
	</head>
	<body>
		<!-- ng-app定义一个模块 -->
		<div ng-app="myapp" ng-controller="myctr">
			<!-- 自定义一个模型 -->
			<input type="text" ng-model="uname" />
			<input type="button" name="clear" value="清除" ng-click="clear()"/>
			<h2>Hello: {{uname}}</h1>
		</div>
	</body>
	<script type="text/javascript">
		var myapp = angular.module("myapp",[]);
		myapp.controller("myctr",["$scope",function($scope){
			$scope.uname = "想到就心酸"
			$scope.clear = function(){
				$scope.uname = ""
			}
		}]);
	</script>
</html>
